﻿<%@ Page Title="" Language="VB" MasterPageFile="~/Administrator/MasterPage.master" AutoEventWireup="false" CodeFile="userList.aspx.vb" Inherits="Administrator_userList" %>

<%--<%@ Register assembly="Devart.Data.Oracle.Web, Version=8.4.171.4, Culture=neutral, PublicKeyToken=09AF7300EEC23701" namespace="Devart.Data.Oracle.Web" tagprefix="cc1" %>--%>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <table style="width:100%;" class="control">
            
                <tr>
                    <td style="text-align: right" width="100">
                        ฝ่าย :</td>
                    <td style="text-align: left; width: 158px;">
                        <asp:DropDownList ID="ddlDepartment" runat="server" CssClass="control" 
                            Width="196px" AutoPostBack="True" Height="25px" >
                        </asp:DropDownList>
                    </td>
                    <td style="text-align: right" width="110">
                        ส่วนงาน/สาขา :</td>
                    <td style="text-align: left; width: 216px;">
                        <asp:DropDownList ID="ddlBranch" runat="server" CssClass="control" 
                            Width="183px" Height="25px">
                        </asp:DropDownList>
                    </td>
                    <td style="text-align: right" width="120">
                        กลุ่มสิทธิ์ :</td>
                    <td style="text-align: left">
                        <asp:DropDownList ID="ddlUserRight" runat="server" CssClass="control" 
                            Width="150px" Height="25px">
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td style="text-align: right">
                        &nbsp; รหัสผู้ใช้งาน :</td>
                    <td style="text-align: left; width: 158px;">
                        <asp:TextBox ID="txtUserName" runat="server" AutoCompleteType="Disabled" 
                            CssClass="control" Height="20px" MaxLength="20" Width="150px"></asp:TextBox>
                    </td>
                    <td style="text-align: right">
                        ชื่อผู้ใช้งาน :</td>
                    <td style="text-align: left; width: 216px;">
                        <asp:TextBox ID="txtFirstName" runat="server" AutoCompleteType="Disabled" 
                            CssClass="control" MaxLength="100" Width="200px"></asp:TextBox>
                    </td>
                    <td style="text-align: right" width="120">
                        นามสกุลผู้ใช้งาน :</td>
                    <td style="text-align: left">
                        <asp:TextBox ID="txtLastName" runat="server" AutoCompleteType="Disabled" 
                            CssClass="control" MaxLength="100" Width="180px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td style="text-align: right">
                        <asp:Label ID="lblActive" runat="server"></asp:Label>
                    </td>
                    <td style="text-align: left; " colspan="2">
                        <asp:RadioButtonList ID="rdolActive" runat="server" 
                            RepeatDirection="Horizontal" Width="222px">
                            <asp:ListItem Value="-1">ทั้งหมด</asp:ListItem>
                            <asp:ListItem Value="0">ใช้งาน</asp:ListItem>
                            <asp:ListItem Value="1">ไม่ใช้งาน</asp:ListItem>
                        </asp:RadioButtonList>
                    </td>
                    <td style="text-align: left; width: 216px;">
                        &nbsp;</td>
                    <td style="text-align: right" width="120">
                        &nbsp;</td>
                    <td style="text-align: left">
                        &nbsp;</td>
                </tr>
                <tr>
                    <td colspan="6" style="text-align: right">
                        <asp:Button ID="btnSearch" runat="server" CssClass="control" 
                            Text="search" Width="80px"  />
                        <asp:Button ID="btnAdd" runat="server" CssClass="control" Text="Add" 
                            Width="80px" />
                        <asp:Button ID="btnModify" runat="server" CssClass="control" Text="Modify" 
                            Width="80px" />
                        <asp:Button ID="btnDelete" runat="server" CssClass="control" Text="Delete" 
                            Width="80px" />
                        <asp:Button ID="btnClear" runat="server" CssClass="control" Text="Clear" 
                            Width="80px" />
                        <asp:Button ID="btnPrint" runat="server" CssClass="control" Text="Print" 
                            Width="80px" />
                    </td>
                </tr>
              
            </table>
             <div align="center">
                  <asp:Label ID="lblMsg" runat="server" CssClass="control" Font-Size="XX-Large" 
                            ForeColor="Red" Height="30px" Visible="False" Font-Bold="True"></asp:Label>
                     
                        <asp:Label ID="lblMsgUser" runat="server" CssClass="control" 
                      Font-Size="Large" ForeColor="Red" Height="20px" Visible="False"></asp:Label>
                     
                        <asp:GridView ID="gvUser" runat="server" AllowPaging="True" 
                            AutoGenerateColumns="False" CellPadding="4" CssClass="control" 
                            ForeColor="#333333" style="margin-right: 0px; margin-bottom: 0px;" 
                            Width="100%" AllowSorting="True">
                            <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
                            <Columns>
                                <asp:CommandField ButtonType="Image" 
                                    SelectImageUrl="~/img/icon/select_icon.gif" ShowSelectButton="True">
                                <ItemStyle Width="50px" />
                                </asp:CommandField>
                                <asp:BoundField DataField="UserName" HeaderText="รหัสผู้ใช้งาน" 
                                    SortExpression="UserName">
                                <ItemStyle HorizontalAlign="Left" Width="100px" />
                                </asp:BoundField>
                                <asp:TemplateField HeaderText="ชื่อ-นามสกุล" SortExpression="EMPNAME">
                                    <ItemTemplate>
                                        <asp:Label ID="lblName" runat="server" CssClass="control" 
                                            Text='<%# eval("EMPNAME") & " " & eval("EMPLASTNAME") %>'></asp:Label>
                                    </ItemTemplate>
                                    <ItemStyle HorizontalAlign="Left" />
                                </asp:TemplateField>
                                <asp:BoundField DataField="USERRIGHTDESC" HeaderText="สิทธิ์การเข้าใช้" 
                                    SortExpression="USERRIGHTDESC">
                                <ItemStyle HorizontalAlign="Left" Width="100px" />
                                </asp:BoundField>
                                <asp:BoundField DataField="ROLENAME" 
                                    HeaderStyle-Width="150px" HeaderText="กลุ่มผู้ใช้" 
                                    SortExpression="ROLENAME">
                                <HeaderStyle Width="150px" />
                                <ItemStyle HorizontalAlign="Left" Width="100px" />
                                </asp:BoundField>
                                <asp:BoundField DataField="DeptName" HeaderText="ชื่อฝ่าย" 
                                    SortExpression="DeptName">
                                <ItemStyle HorizontalAlign="Left" Width="150px" />
                                </asp:BoundField>
                                <asp:BoundField DataField="BranchName" HeaderText="ชื่อสาขา/ส่วนงาน" 
                                    SortExpression="BranchName">
                                <ItemStyle HorizontalAlign="Left" Width="150px" />
                                </asp:BoundField>
                                <asp:TemplateField HeaderText="สถานะ" SortExpression="ISINACTIVE">
                                    <ItemTemplate>
                                        <asp:Label ID="lblActive" runat="server" CssClass="control" 
                                            Text='<%# iif(eval("ISINACTIVE") =0,"ปกติ","ระงับ") %>'></asp:Label>
                                    </ItemTemplate>
                                    <ItemStyle HorizontalAlign="Left" Width="100px" />
                                </asp:TemplateField>
                            </Columns>
                            <FooterStyle BackColor="#E38120" Font-Bold="True" ForeColor="White" />
                            <RowStyle ForeColor="#333333" />
                            <PagerSettings Mode="NumericFirstLast" />
                            <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" 
                    CssClass="cssPager" />
                            <SelectedRowStyle BackColor="#FFFFCC" Font-Bold="True" ForeColor="Navy" />
                            <HeaderStyle BackColor="#E38120" CssClass="control" Font-Bold="True" 
                                ForeColor="White" />
                            <AlternatingRowStyle BackColor="White" />
                            <SortedAscendingCellStyle CssClass="control" />
                            <SortedAscendingHeaderStyle CssClass="control" />
                            <SortedDescendingCellStyle CssClass="control" />
                            <SortedDescendingHeaderStyle CssClass="control" />
                        </asp:GridView>
             </div>
            <div align="right">
                   <asp:Label ID="lblTotal" runat="server" Font-Bold="True" ForeColor="#003300"></asp:Label>
             </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>

